package com.icinfo.cloud.provider.peripheralinterface.xfjdzf.controller;

import com.icinfo.cloud.provider.common.constant.Constant;
import com.icinfo.cloud.provider.peripheralinterface.xfjdzf.dto.XfjdzfDocumentNumberInfoDto;
import com.icinfo.cloud.provider.peripheralinterface.xfjdzf.service.IXfjdzfInterfaceService;
import com.icinfo.framework.common.web.Result;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;


/**
 * 描述：消防监督执法接口前端控制器
 *
 * @author xiangyuyu
 * @date 2022/8/13
 * @since 1.3.2
 */
@RestController
@RefreshScope
@RequestMapping("/peripheralInterface/xfjdzf")
@Slf4j
public class XfjdzfInterfaceController {
    @Resource
    private IXfjdzfInterfaceService xfjdzfInterfaceService;

    /**
     * 描述：【V1.3.2】描述：获取消防监督执法系统文书文号信息
     *
     * @param dto {@link XfjdzfDocumentNumberInfoDto}
     * @return Result<String> 文书文号信息
     * @author xiangyuyu
     * @date 2022/8/13
     * @since 1.3.2
     */
    @PostMapping("getDocumentNumber")
    @ApiOperation(value = "【V2.0.0】描述：获取执法证编号信息", httpMethod = "POST")
    public Result<String> getDocumentNumber(@RequestBody @Validated XfjdzfDocumentNumberInfoDto dto) {
        String documentNumber = xfjdzfInterfaceService.getDocumentNumber(dto);
        return Result.success(Constant.STRING_GET_SUCCESS, documentNumber);
    }
}
